﻿using DomainModel;
using FluentNHibernate.Mapping;

namespace Repository.NHibernate.Mapping
{
    public class UserProfileMap : ClassMap<UserProfile>
    {
        public UserProfileMap()
        {
            Id(x => x.Id).GeneratedBy.Foreign("User");

            Map(x => x.Fio);
            Map(x => x.Phone);
            Map(x => x.BirthDate).Nullable();
            Map(x => x.PhotoUrl);
            Map(x => x.Icq);
            Map(x => x.Skype);
            Map(x => x.AboutMyself);
            Map(x => x.PersonalPage);

            HasOne(x => x.User).Constrained();
        }
    }
}